

MomentsCE = ComputeMoments( ParamsC , GridsC , LC , LhC , zetaC , vC , GE ) ;
 
% Input data
VarDecomp = csvread('source/VarDecompWUW.csv');

% Weighted data
col = 1 ; 

    % without residual
    MeanU_data    = VarDecomp(1,col) ;
    StdU_data     = VarDecomp(2,col) ;
    SdUc_data     = VarDecomp(3,col) ;
    VarUpred_data = VarDecomp(4,col) ;

    VarSep_data   = 100 * VarDecomp(5,col) ;
    VarFind_data  = 100 * VarDecomp(6,col) ;
    Cov_data      = 100 * VarDecomp(7,col) ;

    sep_data_nores   = VarSep_data + Cov_data / 2 ;
    find_data_nores  = VarFind_data + Cov_data / 2 ;

    % with residual
    ratio_data = VarUpred_data / SdUc_data^2 ;
    sep_data   = ratio_data * ( VarSep_data + Cov_data / 2 )  ;
    find_data  = ratio_data * ( VarFind_data + Cov_data / 2 ) ;
    res_data   = 100 - sep_data - find_data ;

    
% Unweighted data
col = 2 ;

    % without residual
    MeanU0_data    = VarDecomp(1,col) ;
    StdU0_data     = VarDecomp(2,col) ;
    SdU0c_data     = VarDecomp(3,col) ;
    VarU0pred_data = VarDecomp(4,col) ;
    VarSep0_data   = 100 * VarDecomp(5,col) ;
    VarFind0_data  = 100 * VarDecomp(6,col) ;
    Cov0_data      = 100 * VarDecomp(7,col) ;

    sep0_data_nores   = VarSep0_data  + Cov0_data / 2 ;
    find0_data_nores  = VarFind0_data + Cov0_data / 2 ;
    
    % with residual
    ratio0_data = VarUpred_data / SdUc_data^2 ;
    sep0_data   = ratio_data * ( VarSep_data + Cov_data / 2 )  ;
    find0_data  = ratio_data * ( VarFind_data + Cov_data / 2 ) ;
    res0_data   = 100 - sep_data - find_data ;




sep_CE  = 100 * MomentsCE.vSep  / MomentsCE.vUfull + 100 * MomentsCE.covSepFind / MomentsCE.vUfull / 2 ;
find_CE = 100 * MomentsCE.vFind / MomentsCE.vUfull + 100 * MomentsCE.covSepFind / MomentsCE.vUfull / 2 ;
res_CE  = 100 - sep_CE - find_CE ;

    
disp('**********************************************************')
fprintf('\n')
disp('                      COMP. EQ.     DATA')
fprintf('\n')
disp(['   Mean U-rate        ' num2str(MomentsCE.MeanU,'%4.3f')  '         '  num2str(MeanU_data,'%4.3f')])
disp(['   Std. U-rate        ' num2str(MomentsCE.StdU,'%4.3f')   '         '  num2str(StdU_data,'%4.3f')])
fprintf('\n')
disp(['   Std. log(s/f)      ' num2str(sqrt(MomentsCE.vU),'%4.3f')  '         ' num2str(sqrt(VarUpred_data),'%4.3f') ])
disp(['      log(sep)        ' num2str(100*(MomentsCE.vSep +0.5*MomentsCE.covSepFind)/MomentsCE.vU,'%4.0f') '%'  '           ' num2str(sep_data_nores,'%4.0f') '%'])               
disp(['      log(find)       ' num2str(100*(MomentsCE.vFind+0.5*MomentsCE.covSepFind)/MomentsCE.vU,'%4.0f') '%'  '           ' num2str(find_data_nores,'%4.0f') '%'])

fprintf('\n')
disp('**********************************************************')













